#include <linux/init.h>
#include <linux/module.h>
#include <linux/ioport.h>
#include <asm/io.h>

int a=0;
module_param(a, int, S_IRUGO);

dev_t device_no=245;

static volatile unsigned char *base = NULL;
static int demo_init(void)
{
	int i = 0;
        printk(KERN_INFO "Hello world\n");
        printk(KERN_INFO "a=%d\n",a);
//        printk(KERN_INFO "ID=%08lx%08lx%08lx%08lx\n",IP1, IP2, IP3, IP4);
	request_mem_region(0x4830a000, 4*1024, "BASE");
	base = ioremap(0x4830a000, 0xFFF);
        printk(KERN_INFO " base(0x%08x) ID=%08x-%08x-%08x-%08x\n", base, readl(base+0x224), readl(base+0x220), readl(base+0x21c), readl(base+0x218));
        printk(KERN_INFO "ID=%08lx-%08lx-%08lx-%08lx\n", *(volatile long *)(base+0x224), *(volatile long *)(base+0x220), *(volatile long *)(base+0x21c), *(volatile long *)(base+0x218));

        return 0;
}

static void demo_exit(void)
{
	iounmap(base);
	release_region(0x4830a000, 4*1024);
        printk(KERN_INFO "Byebye, World\n");
}

MODULE_LICENSE("GPL");

module_init(demo_init);
module_exit(demo_exit);
